package com.power.factory;

import com.power.strategy.LoginStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 登录策略工厂类
 * @Author dingchunlin
 * @Date 2024/07/10 21:58
 * @Version 1.0.0
 */
@Component
public class LoginStrategyFactory {

    @Autowired
    private Map<String,LoginStrategy> loginStrategyMap = new HashMap<>();

    /**
     * 根据登录类型获取登录策略
     * @param loginType 登录类型
     * @return 登录策略
     */
    public LoginStrategy getLoginStrategy(String loginType) {
        return loginStrategyMap.get(loginType);
    }

}
